// 需要获取函数最后一个元素
function compose(f,g){
  return function(value){
    return f(g(value))
  }
}
function reverse(array){
  return array.reverse()
}
function first(array) {
  return array[0]
}
const last = compose(first,reverse)
const array = [1,2,3,4]
console.log(last(array)) //output: 4
